package com.jie.swaggerdemo.Model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 
 * @TableName t_book
 */
@TableName(value ="t_book")
@ApiModel(value="书本对象")
@Data
public class Book implements Serializable {
    /**
     * 
     */
    @ApiModelProperty(value="书本编号")
    @TableId(value = "book_id")
    private String bookId;

    /**
     * 
     */
    @ApiModelProperty(value="书本名称")
    @TableField(value = "book_name")
    private String bookName;

    /**
     * 
     */
    @ApiModelProperty(value="书本价格")
    @TableField(value = "price")
    private Double price;

    /**
     * 
     */
    @ApiModelProperty(value="书本类型")
    @TableField(value = "book_type")
    private String bookType;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public Book() {
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Book other = (Book) that;
        return (this.getBookId() == null ? other.getBookId() == null : this.getBookId().equals(other.getBookId()))
            && (this.getBookName() == null ? other.getBookName() == null : this.getBookName().equals(other.getBookName()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getBookType() == null ? other.getBookType() == null : this.getBookType().equals(other.getBookType()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getBookId() == null) ? 0 : getBookId().hashCode());
        result = prime * result + ((getBookName() == null) ? 0 : getBookName().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getBookType() == null) ? 0 : getBookType().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", bookId=").append(bookId);
        sb.append(", bookName=").append(bookName);
        sb.append(", price=").append(price);
        sb.append(", bookType=").append(bookType);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}